package com.eks.excel.vo;

import cn.gjing.tools.excel.Excel;
import cn.gjing.tools.excel.ExcelField;
import lombok.*;

import java.util.ArrayList;
import java.util.List;

/**
 * SingleHead
 *
 * @author: chenfenghai
 * @version: 1.0
 * @date: 2021-01-15 15:49
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode
@ToString
@Excel("单级表头")
public class SingleHead {
    @ExcelField("姓名")
    private String userName;

    @ExcelField(value = "年龄", format = "0")
    private Integer userAge;

    @ExcelField("性别")
    private String gender;

    @ExcelField("爱好")
    private String favorite;

    public static SingleHead getSingleHead(){
        return SingleHead.builder()
                .userName("张三")
                .userAge(22)
                .gender("男")
                .favorite("打篮球")
                .build();
    }

    public static List<SingleHead> getSingleHeadList(){
        List<SingleHead> list = new ArrayList<>();
        list.add(SingleHead.builder()
                .userName("张三")
                .userAge(22)
                .gender("男")
                .favorite("打篮球")
                .build());
        list.add(SingleHead.builder()
                .userName("李四")
                .userAge(20)
                .gender("女")
                .favorite("逛街")
                .build());
        return list;
    }
}
